package work20250104;

import java.io.*;

/**
 * @author zdl
 * @date 2025/1/4
 */
public class Demo5 {
    public static void main(String[] args) throws IOException {
        //5、编写一个程序，将d:\java目录下的a.txt文件复制到d:\jad目录下。
        FileInputStream fi = new FileInputStream("D:/java/a.txt");
        BufferedInputStream bis  = new BufferedInputStream(fi);
        FileOutputStream fos = new FileOutputStream("D:/jad/a.txt");
        BufferedOutputStream bos  = new BufferedOutputStream(fos);
        int len ;
        while ((len = bis.read()) != -1){
            bos.write(len);
        }
        bos.close();
        bis.close();
    }
}
